<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * @author Anh Nguyen <duyanhnguyen@vccorp.vn>
 * @copyright 2012
 */

class Admin_Layout
{
    private $_CI;

    function __construct()
    {
        $this->_CI =& get_instance();
        $this->_CI->load->library('Minifier');
        $this->_CI->load->library('Blockcache');
    }
    
    public function _loadHeader($headTitle = '')
    {
        $data = array();
        $data['headTitle'] = $headTitle;
        $this->addCssJs();
        $data['combinedCss'] = $this->_CI->minifier->GetCombined('css');
        $data['combinedJs'] = $this->_CI->minifier->GetCombined('js');
	    //echo $this->_CI->blockcache->cache('header_view', $data, 3000);
        $this->_CI->load->view('header_view',$data);
    }
    
    public function _loadLeftMenu()
    {
    	$this->_CI->load->view('left_menu_view');
    }

    public function _loadLeftMenuUser()
    {
    	$this->_CI->load->view('left_menu_user_view');
    }
    
    public function _loadFooter()
    {
		//echo $this->_CI->blockcache->cache('footer_view', '', 3000);
        $this->_CI->load->view('footer_view');
    }
    
    private function addCssJs()
    {
        $this->_CI->minifier->AddCss('style');
        $this->_CI->minifier->AddCss('reset');        
        $this->_CI->minifier->AddCss('markitup/skins/markitup/style');
        $this->_CI->minifier->AddCss('markitup/sets/default/style');
        $this->_CI->minifier->AddCss('smoothness/jquery-ui-1.7.1.custom');
        $this->_CI->minifier->AddCss('markitup/sets/default/style');
        $this->_CI->minifier->AddJs('jquery-1.7.min');
        $this->_CI->minifier->AddJs('jquery-ui-1.7.1.custom.min');
        $this->_CI->minifier->AddJs('hoverIntent');
        $this->_CI->minifier->AddJs('superfish');
        $this->_CI->minifier->AddJs('excanvas.pack');
        $this->_CI->minifier->AddJs('jquery.flot.pack');
        $this->_CI->minifier->AddJs('custom');
        $this->_CI->minifier->AddJs('markitup/jquery.markitup.pack');
        $this->_CI->minifier->AddJs('markitup/sets/default/set');             	       
    }

}

?>